import module from '../../module'

export default name => {
  const root = `${module.code}/${name}/`
  const crud = $http.crud(root)
  //查询线路
  crud.querylineinfo = params => {
    return $http.get('/dispatch/common/querylineinfo', params)
  }
  //查询车站名称
  crud.organizationQuery = params => {
    return $http.get('/baseinfo/organization/query', params)
  }
  //查询计划车次
  crud.querybusinfo = params => {
    return $http.get('/dispatch/common/querybusinfo', params)
  }
  //查询线路明细
  crud.busQuerylinedetailinfo = params => {
    return $http.get('/dispatch/bus_info/querylinedetailinfo', params)
  }
  //查询车票类型
  crud.ticketQuery = params => {
    return $http.get('/baseinfo/ticket_type/query', params)
  }
  //查询车型
  crud.vehicleQuery = params => {
    return $http.get('/baseinfo/vehicle_type/query', params)
  }
  //查询计划车次票价
  crud.querybusprice = params => {
    return $http.get('/dispatch/common/querybusprice', params)
  }
  //查询座位类型
  crud.sateQuery = params => {
    return $http.get('/baseinfo/seat_type/query', params)
  }
  //查询线路明细新接口
  crud.querylinedetailinfo = params => {
    return $http.get('/dispatch/common/querylinedetailinfo', params)
  }
  //修改计划车次
  crud.busUpdate = params => {
    return $http.post('/dispatch/bus_info/update', params)
  }
  //修改车次票价
  crud.prciceUpdate = params => {
    return $http.post('/dispatch/bus_price/update', params)
  }
  //添加计划车次
  crud.busAdd = params => {
    return $http.post('/dispatch/bus_info/add', params)
  }
  //查询线路表
  crud.routeQuery = params => {
    return $http.get('/dispatch/route_info/query', params)
  }
  //新增车次票价
  crud.priceAdd = params => {
    return $http.post('/dispatch/bus_price/add', params)
  }
  //查询车次车辆
  crud.busVehicleQuery = params => {
    return $http.get('/dispatch/bus_vehicle/query', params)
  }
  //座位预留
  crud.reserveSeatQuery = params => {
    return $http.get('/dispatch/bus_reserve_seat/query', params)
  }
  //查询车次票价
  crud.busPriceQuery = params => {
    return $http.get('/dispatch/bus_price/query', params)
  }
  //修改车次车辆
  crud.vehicleUpdate = params => {
    return $http.post('/dispatch/bus_vehicle/update', params)
  }
  //新增车次车辆
  crud.vehicleAdd = params => {
    return $http.post('/dispatch/bus_vehicle/add', params)
  }
  // 车辆列表
  crud.vehicleInfoQuery = params => {
    return $http.get('/baseinfo/vehicle_info/query', params)
  }
  crud.querybusvehicleinfo = params => {
    return $http.get('/dispatch/common/querybusvehicleinfo', params)
  }
  //查询车次列表
  crud.querybusinfoforselect = params => {
    return $http.get('/dispatch/common/querybusinfoforselect', params)
  }
  //获取票价方案
  crud.fareSchemeQuery = params => {
    return $http.get('/dispatch/fare_scheme/query', params)
  }
  return {
    ...crud
  }
}
